<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- 网站图标 -->
    <link rel="shortcut icon" href="../photo/网站.png" type="image/x-icon">
    <title>五育系统学生端登录页面</title>
    <script src="../js/untils/request.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
    <link rel="stylesheet" href="../css/login.css" />
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
    <script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
    <!-- 引入 Element UI 样式 -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-ui/lib/theme-chalk/index.css">
    <!-- 引入 Element UI -->
    <script src="https://cdn.jsdelivr.net/npm/element-ui/lib/index.js"></script>

</head>

<body>
    <div class="shell" id="app">
        <div class="container a-container" id="a-container">
            <form action="" method="" class="form" id="a-form">
                <h2 class="form_title title">创建账号</h2>
                <!-- 留着扩展 , 以后是否有其他注册方法 -->
                <!-- <div class="form_icons">
                    <svg t="1729040971118" class="iconfont icon" viewBox="0 0 1024 1024" version="1.1"
                        xmlns="http://www.w3.org/2000/svg" p-id="16843" width="25" height="25">
                        <path
                            d="M506.942 345.921c25.259 0 42.134-16.916 42.134-42.107 0-25.477-16.848-41.956-42.134-41.956-25.299 0-50.668 16.48-50.668 41.956 0.028 25.204 25.409 42.107 50.668 42.107v0zM506.942 345.921zM271.257 261.857c-25.259 0-50.79 16.48-50.79 41.956 0 25.19 25.532 42.107 50.79 42.107 25.163 0 42.012-16.916 42.012-42.107-0.014-25.477-16.834-41.956-42.012-41.956v0zM271.257 261.857zM1010.654 615.492c0-133.202-123.563-246.702-275.237-258.512 0.205-1.652 0.301-3.373-0.068-5.092-30.406-141.79-182.886-248.695-354.7-248.695-194.15 0-352.119 135.387-352.119 301.793 0 89.279 45.574 169.725 131.946 233.158l-30.106 90.508c-1.939 5.885-0.177 12.37 4.506 16.452 2.853 2.458 6.445 3.741 10.076 3.741 2.335 0 4.697-0.546 6.867-1.625l113.036-56.565 13.926 2.827c34.802 7.154 64.853 13.353 101.868 13.353 10.895 0 40.878-3.987 43.404-7.182 40.755 101.99 153.094 175.61 285.273 175.61 33.86 0 68.13-8.164 98.891-15.866l87.136 47.636c2.307 1.257 4.847 1.911 7.359 1.911 3.441 0 6.881-1.161 9.639-3.413 4.847-3.932 6.841-10.404 5.038-16.33l-22.255-74.001c74.602-58.955 115.521-129.488 115.521-199.708v0zM409.798 665.75c-9.626 0.833-19.388 1.243-29.082 1.243-32.686 0-60.334-5.652-92.31-12.26l-18.582-3.755c-3.195-0.683-6.567-0.245-9.503 1.269l-81.687 40.892 21.231-63.775c2.076-6.24-0.205-13.053-5.57-16.821-82.07-57.207-123.659-126.894-123.659-207.093 0-144.179 139.087-261.516 310.067-261.516 151.142 0 284.959 91.955 312.579 214.261-158.475 2.076-286.706 113.487-286.706 250.32 0 19.893 3.018 39.171 8.11 57.767-1.542-0.382-3.168-0.683-4.887-0.532v0zM860.371 788.699c-4.875 3.673-6.935 10.007-5.188 15.852l13.804 45.903-56.647-30.993c-2.157-1.188-4.588-1.803-7.004-1.803-1.188 0-2.389 0.15-3.564 0.464-30.379 7.674-61.822 15.593-92.433 15.593-142.186 0-257.857-97.717-257.857-217.811 0-120.095 115.658-217.771 257.857-217.771 139.469 0 257.325 99.724 257.325 217.771 0 59.87-37.738 121.255-106.291 172.797v0zM868.181 797.178zM616.454 506.006c-16.848 0-33.696 16.971-33.696 33.792 0 16.944 16.848 33.669 33.696 33.669 25.313 0 42.038-16.725 42.038-33.669 0-16.848-16.725-33.792-42.038-33.792v0zM616.454 506.006zM801.58 506.006c-16.603 0-33.451 16.971-33.451 33.792 0 16.944 16.848 33.669 33.451 33.669 25.231 0 42.257-16.725 42.257-33.669 0-16.848-16.998-33.792-42.257-33.792v0zM801.58 506.006z"
                            fill="#707070" p-id="16844"></path>
                    </svg>
                    <svg t="1729040913309" class="iconfont icon" viewBox="0 0 1024 1024" version="1.1"
                        xmlns="http://www.w3.org/2000/svg" p-id="14606" width="25" height="25">
                        <path
                            d="M576.2 757.2c-21.5 7.9-43.6 13.9-66.2 17.7-62.4 10.7-124.3 8.5-185.5-8.1-4.7-1.3-8.2 0.1-12.1 2.1-33.7 16.9-67.5 33.8-101.2 50.8-10.8 5.5-21.2 6-30.9-1.3-10.2-7.6-13-18-11.1-30.8 4.4-28.5 7.7-57.2 11.6-85.8 0.7-5-2.9-7-5.6-9.7-29.7-28.3-56.4-59.1-75.9-95.4C37.6 482 58 347.2 151 252.8c54.9-55.7 121.3-90.2 197.6-105.5 98.6-19.8 193.4-8.2 282.5 39.3 69 36.8 121.7 89.8 152.9 162.3 17.8 41.2 25 84.4 21.9 130.8-9.7-7.7-19.1-14.2-30.8-15.4-11.9-1.6-23.9 0.7-34.4 6.5 1.1-24.9-2.1-49.7-9.2-73.6-18.1-58.9-54.7-104-105.1-138.3-52.7-35.9-111.5-53.6-174.9-56.3-79.6-3.4-152.8 16-217.2 63.6-60.4 44.8-98.3 103.7-103.9 180-4.3 59.1 14.5 111.5 50.8 158 14.6 18.8 31.7 35.5 50.8 49.7 12.4 9.1 16.3 20.4 12.2 35.1-4.8 17-9.1 34.1-13.5 51.2-0.8 3.1-2.4 6.8 0.6 9.4 3.5 3 6.2-0.5 8.9-2.1 20.3-11.8 40.6-23.5 60.6-35.7 12.2-7.4 24.4-9.5 38.4-5.5 63.6 18.1 131 17.8 194.5-0.7 6.2-1.8 8.8-2.4 9.1 5.9 0.9 21.6 13.3 35.7 33.4 45.7z m0 0"
                            fill="#707070" p-id="14607"></path>
                        <path
                            d="M714.3 586.4c-5.2-2.7-10.3-2-14.8 2.8-24.7 26.4-57.4 43.8-93.1 49.4-24.6 4.1-43.2 29.1-41 52.8 2.6 27.8 24.1 48.4 50.9 48.7 23.9 0.3 47-17.3 50.9-40.2 5.5-35.4 22.6-68.1 48.5-92.8 2.2-1.7 3.8-4 4.6-6.6 1.2-6.2-0.8-11.4-6-14.1z"
                            fill="#707070" p-id="14608"></path>
                        <path
                            d="M955.1 666.3c-11.4-21-32.3-31.8-54.6-28.2-22 3.6-38.7 20.7-42.7 44.3-3.8 21.6-12 42.3-24.3 60.5-7.1 10.3-15.2 19.8-24.2 28.5-3.7 3.7-5.5 8-3.7 13.3 1.5 4.5 5.6 7.6 10.3 7.9 5.4 0.7 8.9-2.7 12.4-6.3 24.6-25.1 53.9-41.2 88.9-46.5 24.7-3.8 42.8-25.5 42.8-51.7 0.3-7.5-1.4-15-4.9-21.8z"
                            fill="#707070" p-id="14609"></path>
                        <path
                            d="M861.1 623.9c-25.7-24.9-41.8-54.8-47.5-90.2-4.2-26.1-28-43.9-55.5-42.1-24.7 1.7-46.4 25-46.6 51.5 0.8 7.9 2.1 16.8 6.9 24.9 8 13.6 19.7 22.8 35.1 25.3 35.8 5.9 65.8 22.3 91.1 47.9 7 7.2 13.6 7.3 19 1.7 5.2-5.6 4.4-12.3-2.5-19z"
                            fill="#707070" p-id="14610"></path>
                        <path
                            d="M773.4 784.6c-36.2-6.6-67.3-22.3-92.7-48.9-2.3-2.4-4.9-4.7-8.5-4.7-5.3-0.1-9.8 1.8-12 6.7-2.6 5.9-0.6 11 4.1 15.5 25.5 24.6 41.7 54 47.5 89.3 4.8 29 28.5 45.9 58.1 43.1 24.4-2.3 43.9-25.2 43.9-51.3-0.1-23.9-16.5-45.3-40.4-49.7z"
                            fill="#707070" p-id="14611"></path>
                    </svg>
                    <svg t="1729041026595" class="iconfont icon" viewBox="0 0 1024 1024" version="1.1"
                        xmlns="http://www.w3.org/2000/svg" p-id="19538" width="25" height="25">
                        <path
                            d="M512 954.181818c-128 0-239.709091-79.127273-281.6-193.163636-20.945455 30.254545-37.236364 41.890909-55.854545 41.890909-9.309091 0-23.272727-4.654545-30.254546-27.927273-6.981818-18.618182-23.272727-69.818182 81.454546-325.818182-2.327273-34.909091 2.327273-69.818182 6.981818-104.727272C260.654545 176.872727 370.036364 69.818182 512 69.818182s251.345455 107.054545 279.272727 274.618182c6.981818 32.581818 9.309091 65.163636 6.981818 97.745454 23.272727 53.527273 109.381818 260.654545 83.781819 332.8-9.309091 23.272727-25.6 25.6-30.254546 27.927273-13.963636 0-30.254545-4.654545-58.181818-44.218182C751.709091 872.727273 640 954.181818 512 954.181818zM249.018182 633.018182l11.636363 65.163636c20.945455 121.018182 128 209.454545 251.345455 209.454546s232.727273-90.763636 251.345455-214.109091l11.636363-69.818182 32.581818 62.836364c13.963636 27.927273 25.6 46.545455 34.909091 55.854545 0-58.181818-48.872727-197.818182-88.436363-286.254545l-2.327273-4.654546v-4.654545c2.327273-30.254545 0-60.509091-6.981818-90.763637C726.109091 244.363636 653.963636 116.363636 512 116.363636s-214.109091 128-232.727273 237.381819c-4.654545 34.909091-9.309091 67.490909-6.981818 100.072727v4.654545l-2.327273 6.981818C197.818182 637.672727 186.181818 712.145455 186.181818 742.4c6.981818-9.309091 16.290909-25.6 32.581818-51.2l30.254546-58.181818z"
                            fill="#707070" p-id="19539"></path>
                        <path
                            d="M474.763636 958.836364l-4.654545-46.545455 23.272727-2.327273c27.927273-2.327273 174.545455-2.327273 204.8-2.327272s53.527273-6.981818 65.163637-11.636364c-9.309091-4.654545-25.6-9.309091-51.2-11.636364l-23.272728-2.327272 2.327273-46.545455 23.272727 2.327273c62.836364 2.327273 100.072727 25.6 100.072728 58.181818 0 39.563636-60.509091 58.181818-116.363637 58.181818-65.163636 0-179.2 0-200.145454 2.327273l-23.272728 2.327273z"
                            fill="#707070" p-id="19540"></path>
                        <path
                            d="M537.6 956.509091h-23.272727c-25.6 0-88.436364 0-134.981818-2.327273H325.818182c-55.854545 0-116.363636-18.618182-116.363637-58.181818 0-32.581818 39.563636-55.854545 100.072728-58.181818l23.272727-2.327273 2.327273 46.545455-23.272728 2.327272c-25.6 2.327273-44.218182 6.981818-51.2 11.636364 11.636364 4.654545 32.581818 11.636364 65.163637 11.636364h55.854545c46.545455 0 109.381818 2.327273 132.654546 2.327272h23.272727v46.545455zM256 442.181818h535.272727v46.545455H256z"
                            fill="#707070" p-id="19541"></path>
                        <path d="M370.036364 442.181818h46.545454v232.727273h-46.545454z" fill="#707070" p-id="19542">
                        </path>
                    </svg>
                </div> -->
                <!-- <span class="form_span">选择注册方式</span> -->
                <form id="registrationForm">
                    <input type="text" id="studentId" class="form_input" placeholder="请输入学号">
                    <input type="text" id="name" class="form_input" placeholder="请输入姓名">
                    <input type="password" id="password" class="form_input" placeholder="请输入密码">
                    <!-- 入学月份选择框 -->
                    <div class="form_input1">
                        <el-date-picker v-model="YearAdmission" type="year" placeholder="请选择入学时间">
                        </el-date-picker>
                    </div>
                    <!-- 性别选择框 -->
                    <select id="gender" class="form_input" style="color: #aaa;">
                        <option value="">请选择性别</option>
                        <!-- 更多选项... -->
                    </select>
                    <!-- 班级选择框 -->
                    <select id="class" class="form_input" style="color: #aaa;">
                        <option value="">请选择班级</option>
                    </select>
                    <!-- 学校选择框 -->
                    <select id="school" class="form_input" style="color: #aaa;">
                        <option value="">请选择学校</option>
                    </select>
                    <a id="form_login">该账号已经被注册!</a>
                    <a id="form_loginn">请选择完整信息,不能为空</a>
                    <button type="button" class="form_button submit submitstyle" onclick="handleRegister()">注册</button>
                </form>
        </div>

        <div class="container b-container" id="b-container">
            <form action="" method="" class="form" id="b-form">
                <h2 class="form_title title">登录账号</h2>
                <!-- 留作扩展功能 -->
                <!-- <div class="form_icons">
                    <svg t="1729040971118" class="iconfont icon" viewBox="0 0 1024 1024" version="1.1"
                        xmlns="http://www.w3.org/2000/svg" p-id="16843" width="25" height="25">
                        <path
                            d="M506.942 345.921c25.259 0 42.134-16.916 42.134-42.107 0-25.477-16.848-41.956-42.134-41.956-25.299 0-50.668 16.48-50.668 41.956 0.028 25.204 25.409 42.107 50.668 42.107v0zM506.942 345.921zM271.257 261.857c-25.259 0-50.79 16.48-50.79 41.956 0 25.19 25.532 42.107 50.79 42.107 25.163 0 42.012-16.916 42.012-42.107-0.014-25.477-16.834-41.956-42.012-41.956v0zM271.257 261.857zM1010.654 615.492c0-133.202-123.563-246.702-275.237-258.512 0.205-1.652 0.301-3.373-0.068-5.092-30.406-141.79-182.886-248.695-354.7-248.695-194.15 0-352.119 135.387-352.119 301.793 0 89.279 45.574 169.725 131.946 233.158l-30.106 90.508c-1.939 5.885-0.177 12.37 4.506 16.452 2.853 2.458 6.445 3.741 10.076 3.741 2.335 0 4.697-0.546 6.867-1.625l113.036-56.565 13.926 2.827c34.802 7.154 64.853 13.353 101.868 13.353 10.895 0 40.878-3.987 43.404-7.182 40.755 101.99 153.094 175.61 285.273 175.61 33.86 0 68.13-8.164 98.891-15.866l87.136 47.636c2.307 1.257 4.847 1.911 7.359 1.911 3.441 0 6.881-1.161 9.639-3.413 4.847-3.932 6.841-10.404 5.038-16.33l-22.255-74.001c74.602-58.955 115.521-129.488 115.521-199.708v0zM409.798 665.75c-9.626 0.833-19.388 1.243-29.082 1.243-32.686 0-60.334-5.652-92.31-12.26l-18.582-3.755c-3.195-0.683-6.567-0.245-9.503 1.269l-81.687 40.892 21.231-63.775c2.076-6.24-0.205-13.053-5.57-16.821-82.07-57.207-123.659-126.894-123.659-207.093 0-144.179 139.087-261.516 310.067-261.516 151.142 0 284.959 91.955 312.579 214.261-158.475 2.076-286.706 113.487-286.706 250.32 0 19.893 3.018 39.171 8.11 57.767-1.542-0.382-3.168-0.683-4.887-0.532v0zM860.371 788.699c-4.875 3.673-6.935 10.007-5.188 15.852l13.804 45.903-56.647-30.993c-2.157-1.188-4.588-1.803-7.004-1.803-1.188 0-2.389 0.15-3.564 0.464-30.379 7.674-61.822 15.593-92.433 15.593-142.186 0-257.857-97.717-257.857-217.811 0-120.095 115.658-217.771 257.857-217.771 139.469 0 257.325 99.724 257.325 217.771 0 59.87-37.738 121.255-106.291 172.797v0zM868.181 797.178zM616.454 506.006c-16.848 0-33.696 16.971-33.696 33.792 0 16.944 16.848 33.669 33.696 33.669 25.313 0 42.038-16.725 42.038-33.669 0-16.848-16.725-33.792-42.038-33.792v0zM616.454 506.006zM801.58 506.006c-16.603 0-33.451 16.971-33.451 33.792 0 16.944 16.848 33.669 33.451 33.669 25.231 0 42.257-16.725 42.257-33.669 0-16.848-16.998-33.792-42.257-33.792v0zM801.58 506.006z"
                            fill="#707070" p-id="16844"></path>
                    </svg>
                    <svg t="1729040913309" class="iconfont icon" viewBox="0 0 1024 1024" version="1.1"
                        xmlns="http://www.w3.org/2000/svg" p-id="14606" width="25" height="25">
                        <path
                            d="M576.2 757.2c-21.5 7.9-43.6 13.9-66.2 17.7-62.4 10.7-124.3 8.5-185.5-8.1-4.7-1.3-8.2 0.1-12.1 2.1-33.7 16.9-67.5 33.8-101.2 50.8-10.8 5.5-21.2 6-30.9-1.3-10.2-7.6-13-18-11.1-30.8 4.4-28.5 7.7-57.2 11.6-85.8 0.7-5-2.9-7-5.6-9.7-29.7-28.3-56.4-59.1-75.9-95.4C37.6 482 58 347.2 151 252.8c54.9-55.7 121.3-90.2 197.6-105.5 98.6-19.8 193.4-8.2 282.5 39.3 69 36.8 121.7 89.8 152.9 162.3 17.8 41.2 25 84.4 21.9 130.8-9.7-7.7-19.1-14.2-30.8-15.4-11.9-1.6-23.9 0.7-34.4 6.5 1.1-24.9-2.1-49.7-9.2-73.6-18.1-58.9-54.7-104-105.1-138.3-52.7-35.9-111.5-53.6-174.9-56.3-79.6-3.4-152.8 16-217.2 63.6-60.4 44.8-98.3 103.7-103.9 180-4.3 59.1 14.5 111.5 50.8 158 14.6 18.8 31.7 35.5 50.8 49.7 12.4 9.1 16.3 20.4 12.2 35.1-4.8 17-9.1 34.1-13.5 51.2-0.8 3.1-2.4 6.8 0.6 9.4 3.5 3 6.2-0.5 8.9-2.1 20.3-11.8 40.6-23.5 60.6-35.7 12.2-7.4 24.4-9.5 38.4-5.5 63.6 18.1 131 17.8 194.5-0.7 6.2-1.8 8.8-2.4 9.1 5.9 0.9 21.6 13.3 35.7 33.4 45.7z m0 0"
                            fill="#707070" p-id="14607"></path>
                        <path
                            d="M714.3 586.4c-5.2-2.7-10.3-2-14.8 2.8-24.7 26.4-57.4 43.8-93.1 49.4-24.6 4.1-43.2 29.1-41 52.8 2.6 27.8 24.1 48.4 50.9 48.7 23.9 0.3 47-17.3 50.9-40.2 5.5-35.4 22.6-68.1 48.5-92.8 2.2-1.7 3.8-4 4.6-6.6 1.2-6.2-0.8-11.4-6-14.1z"
                            fill="#707070" p-id="14608"></path>
                        <path
                            d="M955.1 666.3c-11.4-21-32.3-31.8-54.6-28.2-22 3.6-38.7 20.7-42.7 44.3-3.8 21.6-12 42.3-24.3 60.5-7.1 10.3-15.2 19.8-24.2 28.5-3.7 3.7-5.5 8-3.7 13.3 1.5 4.5 5.6 7.6 10.3 7.9 5.4 0.7 8.9-2.7 12.4-6.3 24.6-25.1 53.9-41.2 88.9-46.5 24.7-3.8 42.8-25.5 42.8-51.7 0.3-7.5-1.4-15-4.9-21.8z"
                            fill="#707070" p-id="14609"></path>
                        <path
                            d="M861.1 623.9c-25.7-24.9-41.8-54.8-47.5-90.2-4.2-26.1-28-43.9-55.5-42.1-24.7 1.7-46.4 25-46.6 51.5 0.8 7.9 2.1 16.8 6.9 24.9 8 13.6 19.7 22.8 35.1 25.3 35.8 5.9 65.8 22.3 91.1 47.9 7 7.2 13.6 7.3 19 1.7 5.2-5.6 4.4-12.3-2.5-19z"
                            fill="#707070" p-id="14610"></path>
                        <path
                            d="M773.4 784.6c-36.2-6.6-67.3-22.3-92.7-48.9-2.3-2.4-4.9-4.7-8.5-4.7-5.3-0.1-9.8 1.8-12 6.7-2.6 5.9-0.6 11 4.1 15.5 25.5 24.6 41.7 54 47.5 89.3 4.8 29 28.5 45.9 58.1 43.1 24.4-2.3 43.9-25.2 43.9-51.3-0.1-23.9-16.5-45.3-40.4-49.7z"
                            fill="#707070" p-id="14611"></path>
                    </svg>
                    <svg t="1729041026595" class="iconfont icon" viewBox="0 0 1024 1024" version="1.1"
                        xmlns="http://www.w3.org/2000/svg" p-id="19538" width="25" height="25">
                        <path
                            d="M512 954.181818c-128 0-239.709091-79.127273-281.6-193.163636-20.945455 30.254545-37.236364 41.890909-55.854545 41.890909-9.309091 0-23.272727-4.654545-30.254546-27.927273-6.981818-18.618182-23.272727-69.818182 81.454546-325.818182-2.327273-34.909091 2.327273-69.818182 6.981818-104.727272C260.654545 176.872727 370.036364 69.818182 512 69.818182s251.345455 107.054545 279.272727 274.618182c6.981818 32.581818 9.309091 65.163636 6.981818 97.745454 23.272727 53.527273 109.381818 260.654545 83.781819 332.8-9.309091 23.272727-25.6 25.6-30.254546 27.927273-13.963636 0-30.254545-4.654545-58.181818-44.218182C751.709091 872.727273 640 954.181818 512 954.181818zM249.018182 633.018182l11.636363 65.163636c20.945455 121.018182 128 209.454545 251.345455 209.454546s232.727273-90.763636 251.345455-214.109091l11.636363-69.818182 32.581818 62.836364c13.963636 27.927273 25.6 46.545455 34.909091 55.854545 0-58.181818-48.872727-197.818182-88.436363-286.254545l-2.327273-4.654546v-4.654545c2.327273-30.254545 0-60.509091-6.981818-90.763637C726.109091 244.363636 653.963636 116.363636 512 116.363636s-214.109091 128-232.727273 237.381819c-4.654545 34.909091-9.309091 67.490909-6.981818 100.072727v4.654545l-2.327273 6.981818C197.818182 637.672727 186.181818 712.145455 186.181818 742.4c6.981818-9.309091 16.290909-25.6 32.581818-51.2l30.254546-58.181818z"
                            fill="#707070" p-id="19539"></path>
                        <path
                            d="M474.763636 958.836364l-4.654545-46.545455 23.272727-2.327273c27.927273-2.327273 174.545455-2.327273 204.8-2.327272s53.527273-6.981818 65.163637-11.636364c-9.309091-4.654545-25.6-9.309091-51.2-11.636364l-23.272728-2.327272 2.327273-46.545455 23.272727 2.327273c62.836364 2.327273 100.072727 25.6 100.072728 58.181818 0 39.563636-60.509091 58.181818-116.363637 58.181818-65.163636 0-179.2 0-200.145454 2.327273l-23.272728 2.327273z"
                            fill="#707070" p-id="19540"></path>
                        <path
                            d="M537.6 956.509091h-23.272727c-25.6 0-88.436364 0-134.981818-2.327273H325.818182c-55.854545 0-116.363636-18.618182-116.363637-58.181818 0-32.581818 39.563636-55.854545 100.072728-58.181818l23.272727-2.327273 2.327273 46.545455-23.272728 2.327272c-25.6 2.327273-44.218182 6.981818-51.2 11.636364 11.636364 4.654545 32.581818 11.636364 65.163637 11.636364h55.854545c46.545455 0 109.381818 2.327273 132.654546 2.327272h23.272727v46.545455zM256 442.181818h535.272727v46.545455H256z"
                            fill="#707070" p-id="19541"></path>
                        <path d="M370.036364 442.181818h46.545454v232.727273h-46.545454z" fill="#707070" p-id="19542">
                        </path>
                    </svg>
                </div> -->
                <!-- <span class="form_span">选择登录方式活电子邮箱登录</span> -->
                <input type="text" class="form_input" placeholder="请输入学号" id="signstudentid">
                <input type="text" class="form_input" placeholder="请输入密码" id="signpassword">
                <a id="form_linkalert">用户名或者密码不正确</a>
                <a class="form_link">忘记密码请联系老师或者年级管理员</a>
                <button class="form_button button submit" onclick="singin()">登录</button>
            </form>
        </div>

        <div class="switch" id="switch-cnt">
            <div class="switch_circle"></div>
            <div class="switch_circle switch_circle-t"></div>
            <div class="switch_container" id="switch-c1">
                <h2 class="switch_title title" style="letter-spacing: 0;">欢迎登录五育平台</h2>
                <p class="switch_description description">已有账号，去登录</p>
                <button class="switch_button button switch-btn">登录</button>
            </div>

            <div class="switch_container is-hidden" id="switch-c2">
                <h2 class="switch_title title" style="letter-spacing: 0;">来啦，我的朋友</h2>
                <p class="switch_description description">去注册账号，来体验五育平台</p>
                <button class="switch_button switch-btn submitstyle">注册</button>
            </div>
        </div>
    </div>
    <script type="module">
        // 部分用vue
        const app = new Vue({
            el: '#app',
            data: {
                YearAdmission: "",
                msg: 'Hello Vue!'
            }
        })
        // 引入http
        const httpService = new HttpService('http://60.205.234.107:7512');
        // const httpService = new HttpService('http:localhost:8080');

        // 定义年级、班级和学校的选项
        var classOptions = [];
        var schoolOptions = [];
        var genderOptions = ['男', '女'];
        populateSelect('gender', genderOptions);

        // 获取字典信息
        const dictName1 = 'class_name'
        const dictName3 = 'school_name'
        async function fetchOptions(dictName, fileld, type) {

            try {
                const res = await httpService.get(`/system/dict/data/type/${dictName}`);
                if (res.code === 200) {
                    const Options = res.data.map(item => item.dictLabel); // 使用 `map` 简化提取逻辑
                    if (type == 1) classOptions = Options
                    if (type == 2) schoolOptions = Options
                    populateSelect(fileld, Options);
                } else {
                    console.error('Failed to fetch grade options:', res.message);
                }
            } catch (error) {
                console.error('Error fetching grade options:', error);
            }
        }
        fetchOptions(dictName1, 'class', 1)
        // fetchOptions(dictName2, 'grade')
        fetchOptions(dictName3, 'school', 2)

        // 动态生成选项的函数
        function populateSelect(selectId, options) {
            const selectElement = document.getElementById(selectId);
            options.forEach((optionText, index) => {
                const option = document.createElement('option');
                option.value = (index + 1).toString(); // 选项值从1开始
                option.textContent = optionText;
                selectElement.appendChild(option);
            });
        }


        function handleRegister() {

            // 获取各个表单字段的值
            var studentId = document.getElementById('studentId').value;
            var name = document.getElementById('name').value;
            var password = document.getElementById('password').value;
            var gender = document.getElementById('gender').value;
            var YearAdmission = (new Date(app.YearAdmission)).getFullYear().toString();
            var classValue = document.getElementById('class').value;
            var school = document.getElementById('school').value;

            if (!studentId || !name || !password || !gender || !YearAdmission || !classValue || !school) {
                document.getElementById("form_loginn").style.display = "block"
                return
            }

            // 将数据组织成一个对象
            var formData = {
                studentId: studentId,
                name: name,
                password: password,
                gender: genderOptions[gender - 1] === '男' ? 1 : 0,
                yearAdmission: YearAdmission,
                studentclass: classOptions[classValue - 1],
                scchoolMeaasge: schoolOptions[school - 1]
            };  
            
            console.log(formData);
            
            // 发送 POST 请求
            httpService.post('/students/students', formData)
                .then(response => {
                    console.log(response);
                    if (response.code == 200) {
                        alert("注册成功");
                        // 用户名存本地
                        localStorage.setItem("StudentId", studentId)
                        // 跳转到主页
                        window.location.href = "../html/index.html"
                    } else {
                        document.getElementById("form_login").style.display = "block"
                    }
                })
                .catch(error => {
                });
        }


        function singin() {
            var studentId = document.getElementById('signstudentid').value;
            var password = document.getElementById('signpassword').value;
            httpService.post(`/students/students/${studentId}/${password}`)
                .then(response => {
                    console.log("111");
                    
                    console.log(response);
                    
                    if (response.msg == "true") {
                        // 用户名存本地
                        localStorage.setItem("StudentId", studentId)
                        // 跳转到主页
                        window.location.href = "../html/index.html"
                    } else {
                        document.getElementById("form_linkalert").style.display = "block"
                    }
                })
                .catch(error => {
                });
        }
        window.singin = singin
        window.handleRegister = handleRegister


        // 维持注册登录页面切换的功能 , 不要乱动
        let switchCtn = document.querySelector("#switch-cnt");
        let switchC1 = document.querySelector("#switch-c1");
        let switchC2 = document.querySelector("#switch-c2");
        let switchCircle = document.querySelectorAll(".switch_circle");
        let switchBtn = document.querySelectorAll(".switch-btn");
        let aContainer = document.querySelector("#a-container");
        let bContainer = document.querySelector("#b-container");
        let allButtons = document.querySelectorAll(".submit");

        let getButtons = (e) => e.preventDefault()
        let changeForm = (e) => {
            switchCtn.classList.add("is-gx");
            setTimeout(function () {
                switchCtn.classList.remove("is-gx");
            }, 1500)
            switchCtn.classList.toggle("is-txr");
            switchCircle[0].classList.toggle("is-txr");
            switchCircle[1].classList.toggle("is-txr");

            switchC1.classList.toggle("is-hidden");
            switchC2.classList.toggle("is-hidden");
            aContainer.classList.toggle("is-txl");
            bContainer.classList.toggle("is-txl");
            bContainer.classList.toggle("is-z");
        }
        let shell = (e) => {
            for (var i = 0; i < allButtons.length; i++)
                allButtons[i].addEventListener("click", getButtons);
            for (var i = 0; i < switchBtn.length; i++)
                switchBtn[i].addEventListener("click", changeForm)
        }
        window.addEventListener("load", shell);

    </script>
</body>

</html>